package apig.client;

import apig.client.serviface.*;

import com.google.gwt.core.client.*;
import com.google.gwt.user.client.rpc.*;

public class Stubman {
	
	public static final int TIMER_DELAY = 5000;
	
	public static final String LAB_ID = "lab_id";

	private static Stubman s;
	private ApigServiceAsync service;

	public static final Stubman getStubman() {
		if (s == null) {
			s = new Stubman();
		}
		return s;
	}

	private Stubman() {
		// TODO: resolve danger with the locations

		// service
		Object comsaObject = GWT.create(ApigService.class);
		((ServiceDefTarget) comsaObject)
				.setServiceEntryPoint("/common_service");
		service = (ApigServiceAsync) comsaObject;
	}
	
	public ApigServiceAsync getService() {
		return service;
	}
}
